From ca49c64543864d55c114246f48b28d680c821909 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Tue, 27 Jun 2017 18:29:55 +0100 Subject: [PATCH] xen/pt: Unlock d->event_lock on error paths MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Introduced by c/s fba00494268 "x86/pt: enable binding of GSIs to a PVH Dom0" Spotted by Coverity. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Reviewed-by: Roger Pau Monné --- xen/drivers/passthrough/io.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index 2fdbba6eb1..25e3fb4078 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -490,7 +490,11 @@ int pt_irq_create_bind( /* MSI_TRANSLATE is not supported for the hardware domain. */ if ( pt_irq_bind->irq_type != PT_IRQ_TYPE_PCI || pirq >= hvm_domain_irq(d)->nr_gsis ) + { + spin_unlock(&d->event_lock); + return -EINVAL; + } guest_gsi = pirq; } @@ -523,6 +527,8 @@ int pt_irq_create_bind( if ( mask < 0 || trigger_mode < 0 ) { + spin_unlock(&d->event_lock); + ASSERT_UNREACHABLE(); return -EINVAL; } -- 2.30.2